package com.drobot.control;

public abstract class Job extends Thread {

	private float time;

	long executionTime;

	public Job() {
	}

	@Override
	public void run() {
		executionTime = System.currentTimeMillis();
		while (!isInterrupted()) {
			if (System.currentTimeMillis() - executionTime > time) {
				onExecute();
				executionTime = System.currentTimeMillis();
			}
		}
		super.run();
	}

	public float getTime() {
		return time;
	}

	public void setTime(float time) {
		this.time = time;
	}

	public void onExecute() {

	}

}
